﻿using habbo.Kernel.Packets.Interfaces;
using habbo.Kernel.Packets.Messages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace habbo.Kernel.Packets.com.sulake.habbo.communication.messages.incoming.room
{
    class InitRoom : IMessageEvent
    {
        public void Invoke(Network.Session Session, Messages.ClientPacket Packet)
        {
            ServerPacket packet2 = new ServerPacket(322);
            packet2.Append("model_b");
            packet2.Append(1);
            Session.Send(packet2);

            ServerPacket packet3 = new ServerPacket(1899);
            packet3.Append("wallpaper");
            packet3.Append(903);
            Session.Send(packet3);

            ServerPacket packet4 = new ServerPacket(1899);
            packet4.Append("floor");
            packet4.Append(110);
            Session.Send(packet4);

            ServerPacket packet5 = new ServerPacket(1899);
            packet5.Append("landscape");
            packet5.Append("0.0");
            Session.Send(packet5);

            ServerPacket packet22 = new ServerPacket(2042);
            packet22.Append(0);
            Session.Send(packet22);

            string anModel = "xxxxxxxxxxxx" + Convert.ToChar(13) + "xxxxx0B0CC01" + Convert.ToChar(13) + "xxxxx000CC00" + Convert.ToChar(13) + "xxxxx000CC00" + Convert.ToChar(13) + "xxxxx0000000" + Convert.ToChar(13) + "000000000000" + Convert.ToChar(13) + "x00000000000" + Convert.ToChar(13) + "x00000000000" + Convert.ToChar(13) + "x00B0B100000" + Convert.ToChar(13) + "x00B0110B000" + Convert.ToChar(13) + "x00000000000" + Convert.ToChar(13) + "xxxxxxxxxxxx" + Convert.ToChar(13) + "xxxxxxxxxxxx" + Convert.ToChar(13) + "xxxxxxxxxxxx" + Convert.ToChar(13) + "xxxxxxxxxxxx" + Convert.ToChar(13) + "xxxxxxxxxxxx" + Convert.ToChar(13) + "";
            string Model = "xxxxxxxxxxxx" + Convert.ToChar(13) + "xxxxx0000000" + Convert.ToChar(13) + "xxxxx0000000" + Convert.ToChar(13) + "xxxxx0000000" + Convert.ToChar(13) + "xxxxx0000000" + Convert.ToChar(13) + "000000000000" + Convert.ToChar(13) + "x00000000000" + Convert.ToChar(13) + "x00000000000" + Convert.ToChar(13) + "x00000000000" + Convert.ToChar(13) + "x00000000000" + Convert.ToChar(13) + "x00000000000" + Convert.ToChar(13) + "xxxxxxxxxxxx" + Convert.ToChar(13) + "xxxxxxxxxxxx" + Convert.ToChar(13) + "xxxxxxxxxxxx" + Convert.ToChar(13) + "xxxxxxxxxxxx" + Convert.ToChar(13) + "xxxxxxxxxxxx" + Convert.ToChar(13);
            ServerPacket Model1 = new ServerPacket(2774);
            Model1.Append(anModel);
            Session.Send(Model1);

            ServerPacket Model2 = new ServerPacket(1250);
            Model2.Append(Model);
            Session.Send(Model2);


            ServerPacket InitPlayers = new ServerPacket(2640);
            InitPlayers.Append(1); //active players?? :)

            InitPlayers.Append(Session.Character.Id);
            InitPlayers.Append(Session.Character.Username);
            InitPlayers.Append(Session.Character.Motto);
            InitPlayers.Append(Session.Character.Figure);
            InitPlayers.Append(Session.Character.Id);
            InitPlayers.Append(0); //DoorX needs calculations
            InitPlayers.Append(5); //DoorY needs calculations
            InitPlayers.Append("0");
            InitPlayers.Append(0);
            InitPlayers.Append(1);
            InitPlayers.Append(Session.Character.Gender);
            InitPlayers.Append(0);
            InitPlayers.Append(-1);
            InitPlayers.Append(string.Empty);
            InitPlayers.Append(string.Empty);
            InitPlayers.Append(0);
            Session.Send(InitPlayers);
        }
    }
}
